//右下 树状图
$.get('http://127.0.0.1:5000/task9').done(function (data) {
    var myeCharts = echarts.init(document.querySelector('.panel .tree'))
    myeCharts.setOption(option = {
        title: {
                text: '即食商品类型',
                textStyle: {
                    color: '#ffffff'
                }
            },
        tooltip: {
            trigger: 'item',
            triggerOn: 'mousemove'
        },
        series: [
            {
                type: 'tree',
                data: data.data,
                top: '8%',  left: '13%',  bottom: '5%', right: '19%',
                roam:true,
                symbolSize: 5,
                initialTreeDepth:1,
                label: {
                normal: {
                  position: 'right',
                  fontStyle:'normal', //文字字体的风格。'normal''italic''oblique'
                  verticalAlign: 'middle',//标签垂直对齐方式。可以设置'top', 'middle', 'bottom'。
                  align: 'right',//文字水平对齐方式，默认自动。可选：'left''center''right'
                  fontFamily : '宋体', //'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei''宋体'
                  fontSize: 15,
                  fontWeight: 'bolder',		//字体加粗'normal''bold''bolder''lighter'
                  color: "white"
                }
              },
                leaves: {
                    label: {
                        position: 'right',
                        verticalAlign: 'middle',
                        align: 'left',
                        rotate: 0,
                        fontSize: 12,
                        fontFamily : '宋体',
                    }
                },
                emphasis: {
                    focus: 'descendant'
                },
                expandAndCollapse: true,
                animationDuration: 550,
                animationDurationUpdate: 750
            }
        ]
    })
})